/*
 * Copyright @ 2022 bingye
 * com.iflytek.zhcs.common.fastdfs.config 09:53
 * All right reserved.
 */

package com.itheima.mp.configuration;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @desc
 * @author: weili23
 * @params
 * @Date: 2024/5/16 9:36
 * @version: 1.0
 */
@Configuration
public class MinioConfig {

    @Autowired
    private  MinioProperties minioProperties;
    @Bean
    public MinioClient minioClient(){
        return MinioClient.builder().endpoint(minioProperties.getEndPoint()).credentials(minioProperties.getUserKey(), minioProperties.getUserPassword()).build();
    }

    /*@Bean
    public MinioProperties minioProperties(){
        return new MinioProperties();
    }*/
}
